using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Runtime.InteropServices;

namespace Zsa.Emulation.Render.Video
{

    /// <summary>
    /// The resolution settings.
    /// </summary>
    [StructLayout(LayoutKind.Sequential)]
    public struct ResolutionDepthSettings
    {
        #region Fields
        /// <summary>
        /// The resolution.
        /// </summary>
        private readonly Size _Resolution;

        /// <summary>
        /// The color depth in bits.
        /// </summary>
        private readonly byte _ColorDepth;
        #endregion Fields


        #region Constructor
        /// <summary>
        /// Initializes a new instance of the <see cref="T:ResolutionDepthSettings"/> class.
        /// </summary>
        /// <param name="resolution">The resolution.</param>
        /// <param name="depth">The depth.</param>
        public ResolutionDepthSettings(Size resolution,
            byte depth)
        {
            if (depth > 64 )
            {
                throw new ArgumentOutOfRangeException(
                    "depth",
                    depth,
                    "The color depth must be between 8 and 64 !"
                    );
            }
            _ColorDepth = depth;
            _Resolution = resolution;
        }
        #endregion Constructor

        /// <summary>
        /// Gets the resolution.
        /// </summary>
        /// <value>The resolution.</value>
        public Size Resolution
        {
            get
            {
                return _Resolution;
            }
        }

        /// <summary>
        /// Gets the color depth.
        /// </summary>
        /// <value>The color depth.</value>
        public int ColorDepth
        {
            get
            {
                return _ColorDepth;
            }
        }

        

    }
}
